package com.ibm.android.camera;

import java.io.IOException;

import android.hardware.Camera;
import android.hardware.Camera.Parameters;
import android.view.SurfaceHolder;

public class AndroidCamera implements ICamera {
	Camera mCamera = null;

	@Override
	public void setPreviewDisplay(SurfaceHolder holder) throws IOException {
		mCamera.setPreviewDisplay(holder);
	}

	@Override
	public Parameters getParameters() {
		return mCamera.getParameters();
	}

	@Override
	public void setParameters(Parameters p) {
		mCamera.setParameters(p);
	}

	@Override
	public void startPreview() {
		mCamera.startPreview();
	}

	@Override
	public void stopPreview() {
		mCamera.stopPreview();
	}

	@Override
	public void open() {
		mCamera = Camera.open();
	}

	@Override
	public void release() {
		mCamera.release();
		mCamera = null;
	}

	@Override
	public void setPreviewCallback(PreviewCallback callback) {
		mCamera.setPreviewCallback(callback);
	}

	@Override
	public void setOneShotPreviewCallback(PreviewCallback previewCallback) {
		mCamera.setOneShotPreviewCallback(previewCallback);
	}

}
